cssshadowvalue: Add a cache for blurred Pango layouts
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 29 Aug 2014 20:51:30 +0000 (13:51 -0700)
committerBenjamin Otte <otte@redhat.com>
Sun, 5 Oct 2014 23:58:31 +0000 (01:58 +0200)
commitdadc37e64db443425712ab960064ee32d42d2cad
tree2be3219558e1f46215881a9670be25709c036aae
parent919bdff7ac09dc7ce8c8401684cfae743cc2691a
cssshadowvalue: Add a cache for blurred Pango layouts

Drawing text with Pango is quite expensive, and drawing text and also
blurring it is *really* expensive. To prevent us from drawing a lot of
text and then blurring it a lot is *really* expensive.

We now cache the blurred pixels for the last layout and shadow we made,
which means we can repeatedly draw labels with a blurred text-shadow
extremely fast.

To detect whether the shadow is up-to-date, we track the serial of the
PangoLayout alongside the radius of the box shadow. We don't support
inset shadows nor spread on text-shadow, so we don't need to track
these.
gtk/gtkcssshadowvalue.c